package com.lucker.ds.model;

/**
 * m_user
 * @author 
 */
public class MUser extends BaseValueObject {
    private Long id;

    private String userName;

    private String password;

    private String userWxOpenid;

    private String userHeaderPic;

    private String nickName;

    private String realName;

    private Integer roleId;

    private Integer defualtDomainId;

    private String defualtDomainName;

    private Boolean isDelete;

    private Boolean isFreeze;

    private String customQuerySqlText = null;

    private String orderStr = null;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUserWxOpenid() {
        return userWxOpenid;
    }

    public void setUserWxOpenid(String userWxOpenid) {
        this.userWxOpenid = userWxOpenid;
    }

    public String getUserHeaderPic() {
        return userHeaderPic;
    }

    public void setUserHeaderPic(String userHeaderPic) {
        this.userHeaderPic = userHeaderPic;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    public Integer getDefualtDomainId() {
        return defualtDomainId;
    }

    public void setDefualtDomainId(Integer defualtDomainId) {
        this.defualtDomainId = defualtDomainId;
    }

    public String getDefualtDomainName() {
        return defualtDomainName;
    }

    public void setDefualtDomainName(String defualtDomainName) {
        this.defualtDomainName = defualtDomainName;
    }

    public Boolean getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Boolean isDelete) {
        this.isDelete = isDelete;
    }

    public Boolean getIsFreeze() {
        return isFreeze;
    }

    public void setIsFreeze(Boolean isFreeze) {
        this.isFreeze = isFreeze;
    }

    public void setCustomQuerySqlText(String customQuerySqlText) {
        this.customQuerySqlText = customQuerySqlText;
    }

    public String getCustomQuerySqlText() {
        return customQuerySqlText;
    }

    public void orderById(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by id asc";
            }else{
                this.orderStr = this.orderStr + ",id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by id desc";
            }else{
                this.orderStr = this.orderStr + ",id desc";
            }
        }
    }

    public void orderByUserName(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by user_name asc";
            }else{
                this.orderStr = this.orderStr + ",user_name asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by user_name desc";
            }else{
                this.orderStr = this.orderStr + ",user_name desc";
            }
        }
    }

    public void orderByPassword(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by password asc";
            }else{
                this.orderStr = this.orderStr + ",password asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by password desc";
            }else{
                this.orderStr = this.orderStr + ",password desc";
            }
        }
    }

    public void orderByUserWxOpenid(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by user_wx_openid asc";
            }else{
                this.orderStr = this.orderStr + ",user_wx_openid asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by user_wx_openid desc";
            }else{
                this.orderStr = this.orderStr + ",user_wx_openid desc";
            }
        }
    }

    public void orderByUserHeaderPic(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by user_header_pic asc";
            }else{
                this.orderStr = this.orderStr + ",user_header_pic asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by user_header_pic desc";
            }else{
                this.orderStr = this.orderStr + ",user_header_pic desc";
            }
        }
    }

    public void orderByNickName(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by nick_name asc";
            }else{
                this.orderStr = this.orderStr + ",nick_name asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by nick_name desc";
            }else{
                this.orderStr = this.orderStr + ",nick_name desc";
            }
        }
    }

    public void orderByRealName(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by real_name asc";
            }else{
                this.orderStr = this.orderStr + ",real_name asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by real_name desc";
            }else{
                this.orderStr = this.orderStr + ",real_name desc";
            }
        }
    }

    public void orderByRoleId(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by role_id asc";
            }else{
                this.orderStr = this.orderStr + ",role_id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by role_id desc";
            }else{
                this.orderStr = this.orderStr + ",role_id desc";
            }
        }
    }

    public void orderByDefualtDomainId(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by defualt_domain_id asc";
            }else{
                this.orderStr = this.orderStr + ",defualt_domain_id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by defualt_domain_id desc";
            }else{
                this.orderStr = this.orderStr + ",defualt_domain_id desc";
            }
        }
    }

    public void orderByDefualtDomainName(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by defualt_domain_name asc";
            }else{
                this.orderStr = this.orderStr + ",defualt_domain_name asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by defualt_domain_name desc";
            }else{
                this.orderStr = this.orderStr + ",defualt_domain_name desc";
            }
        }
    }

    public void orderByIsDelete(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by is_delete asc";
            }else{
                this.orderStr = this.orderStr + ",is_delete asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by is_delete desc";
            }else{
                this.orderStr = this.orderStr + ",is_delete desc";
            }
        }
    }

    public void orderByIsFreeze(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by is_freeze asc";
            }else{
                this.orderStr = this.orderStr + ",is_freeze asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by is_freeze desc";
            }else{
                this.orderStr = this.orderStr + ",is_freeze desc";
            }
        }
    }
}